aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/routes/submission_matches/[match_id].svelte
blob: 586b2c274988d41f2caa7edb319d97f3bd9d8fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<script lang="ts" context="module">
  export async function load({ page }) {
    const res = await fetch(`/api/submission_match_log/${page.params["match_id"]}`, {
      headers: {
        "Content-Type": "application/json",
      },
    });

    if (res.ok) {
      return {
        props: {
          matchLog: await res.text(),
        },
      };
    }

    return {
      status: res.status,
      error: new Error("failed to load match"),
    };
  }
</script>

<script lang="ts">
  import Visualizer from "$lib/components/Visualizer.svelte";
  export let matchLog: string;
</script>

<div>
  <Visualizer {matchLog} />
</div>